<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="database.DAO, golf.Guild,golf.ItemList"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>현재 가입된 길드 정보</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
	function go_URL(url)
	{
        location.href = url;
	}
//-->
</SCRIPT>
</head>
<body>
<h1>현재 가입된 길드 정보</h1>
<%
	DAO dao = DAO.getInstance();
	int charNo = (Integer)session.getAttribute("charNo"); 
	Guild.GuildMember member = dao.getGuildMember(charNo);
	if(member == null){
		out.println("가입된 길드가 없습니다. 길드가입 메뉴에서 먼저 길드를 가입해주세요.");
	}
	else{
		Guild guild = dao.getGuild(member.getGuild_no());
		
%>
<table align="center" cellpadding="0" cellspacing="0" width="80%">
    <tr>
        <td width="100"><span style="font-size:9pt;">길드명</span></td>
        <td width="500"><span style="font-size:9pt;"><%=guild.getName() %></span></td>
    </tr>
    <tr>
        <td width="100"><span style="font-size:9pt;">직책</span></td>
        <td width="500"><span style="font-size:9pt;"><%=member.getJob_name() %></span></td>
    </tr>
    <tr>
        <td width="100"><span style="font-size:9pt;">길드원 수</span></td>
        <td width="500"><span style="font-size:9pt;"><%=guild.getMember_cnt() %></span>        </td>
    </tr>
    <tr>
        <td width="100"><span style="font-size:9pt;">길드 포인트</span></td>
        <td width="500"><span style="font-size:9pt;"><%=guild.getPoint() %></span>        </td>
    </tr>
    <tr>
        <td width="100"><span style="font-size:9pt;">길드 등급</span></td>
        <td width="500"><span style="font-size:9pt;"><%=guild.getGrade().getName() %></span>        </td>
    </tr>
    <tr>
        <td width="100"><span style="font-size:9pt;">길드 경험치 혜택</span></td>
        <td width="500"><span style="font-size:9pt;"><%=guild.getGrade().getBenefit_exp() %></span>        </td>
    </tr>
</table>
<form name="form1" method="post" action="../post/postTransItem.jsp">
    <p><span style="font-size:9pt;">길드아이템</span></p>
    <%
    	int guildno = (Integer)session.getAttribute("guildNo");
		ItemList[] gitems = dao.getGuildItemList(guildno);
		
	%>
    
    <table border="1" cellspacing="0" bordercolordark="white" bordercolorlight="black" width="1165">
        <tr>
            <td width="38"><span style="font-size:9pt;">&nbsp;</span></td>
            <td width="157"><span style="font-size:9pt;">아이템이름</span></td>
            <td width="83"><span style="font-size:9pt;">필요속성</span></td>
            <td width="85"><span style="font-size:9pt;">효과</span></td>
            <td width="84"><span style="font-size:9pt;">내구도</span></td>
            <td width="112"><span style="font-size:9pt;">필요레벨</span></td>
            <td width="112"><span style="font-size:9pt;">필요타이틀</span></td>
            <td width="112"><span style="font-size:9pt;">제한모델</span></td>
            <td width="112"><span style="font-size:9pt;">분류</span></td>
        </tr>
        <%
        if(gitems!=null)
		{
        for( ItemList item4 : gitems ){ %>
        <tr>
            <td width="38"><span style="font-size:9pt;"><input type="checkbox" name="seqNo" value=<%=item4.getSeq_No()%>></span></td>
            <td width="157"><span style="font-size:9pt;"><%=item4.getName() %></span></td>
            <td width="83"><span style="font-size:9pt;"><%=item4.getReqPropertyString() %></span></td>
            <td width="85"><span style="font-size:9pt;"><%=item4.getEffectPropertyString() %></span></td>
            <td width="84"><span style="font-size:9pt;"><%=item4.getCurr_durability() %>/<%=item4.getBasic_durability() %></span></td>
            <td width="112"><span style="font-size:9pt;"><%=item4.getReq_level() %></span></td>
            <td width="55"><span style="font-size:9pt;">
            <%if(item4.getReq_character_grade()!=null) 
            	out.println(item4.getReq_character_grade().getName());
            else
            	out.println("없음");%></span></td>
            <td width="55"><span style="font-size:9pt;">
            <%if(item4.getReq_model()!=null) 
            	out.println(item4.getReq_model().getName());
            else
            	out.println("없음");%></span></td>
            <td width="112"><span style="font-size:9pt;"><%=item4.getCategory_name() %></span></td>
        </tr>
        <%} 
		}
    	%>
        
    </table>
    <p><span style="font-size:9pt;"><input type="submit" name="action" value="toInventory"><input type="hidden" name="from" value="guildItem"></span></p>
</form>

<% 
	}
%>
</body>
</html>